import { axios } from '@/utils/request'

/**
 * 分页查询流程部署列表
 * @param query
 * @returns {*}
 */
export function pageDeploy(query) {
  return axios({
    url: '/workflow/deploy/page',
    method: 'get',
    params: query
  })
}

/**
 * 查询流程发布列表
 * @param query
 * @returns {*}
 */
export function listPublish(query) {
  return axios({
    url: '/workflow/deploy/publishList',
    method: 'get',
    params: query
  })
}

/**
 * 获取流程模型流程图
 * @param definitionId
 * @returns {*}
 */
export function getBpmnXml(definitionId) {
  return axios({
    url: '/workflow/deploy/bpmnXml/' + definitionId,
    method: 'get'
  })
}

/**
 * 修改流程状态
 * @param params
 * @returns {*}
 */
export function changeState(params) {
  return axios({
    url: '/workflow/deploy/changeState',
    method: 'put',
    params: params
  })
}

/**
 * 删除流程部署
 * @param deployIds
 * @returns {*}
 */
export function delDeploy(deployIds) {
  return axios({
    url: '/workflow/deploy/' + deployIds,
    method: 'delete'
  })
}
